{% extends "base.html" %}

{% block content %}
		<div id="name" style="margin: 30px;">
			<h1>Collection sample</h1>
			<p>These forms have been dynamically created from database definitions.<p>
			<strong>See the <a href="{% url index %}">single form demo</a>.</strong>
			
			<form action="." method="post" accept-charset="utf-8" enctype="multipart/form-data">
			    {% for form in forms %}
			    	<h2>{{ form.meta.title }}</h2>
			    	<h2>{{ form.meta.description }}</h2>
			    	
					{% if form.non_field_errors %}
						{{ form.non_field_errors.as_ul }}
					{% endif %}
					{% for field in form %}
						{% if not field.is_hidden %}
							<div class="form-row{% if field.field.required %} required{% endif %}">
								{{ field.errors }}
								{% if field.field.is_checkbox %}
									{{ field }} {{ field.label_tag }}
								{% else %}
									{{ field.label_tag }} {{ field }}
								{% endif %}
												
								{% if field.help_text %}
									<p>{{ field.help_text }}</p>
								{% endif %}
							</div>
						{% else %}
							{{ field }}
						{% endif %}
					{% endfor %}
			    {% endfor %}
			    
			    <input type="submit" value="Save" />
	        </form>
		</div>
{% endblock %}
